package mapSystem.interaction;

import java.awt.image.BufferedImage;

import tools.GameElement;


public class Trap extends TileAction{

	public Trap() {
	}
	public Trap(int xx, int yy, BufferedImage img, GameElement e, int sa, int pa)
	{
		x = xx;
		y = yy;
		image = img;
		element = e;
		
		selfActivatable = true;
		playerActivatable = true;
		
		visible = true;
		
		if(sa == 0) selfActivatable = false;
		else selfActivatable = true;
		
		if(pa == 0) playerActivatable = false;
		else playerActivatable = true;
	}
	
	@Override
	public GameElement autoActivate() {
		if(selfActivatable) 
		{
			return new GameElement(element.getImage(), element.getRect(), 
					element.getXVel(), element.getYVel(), element.getID());		
		}
		return null;
	}
	@Override
	public GameElement playerActivated() {
		if(playerActivatable)
		{
			return new GameElement(element.getImage(), element.getRect(), 
					element.getXVel(), element.getYVel(), element.getID());
		}
		return null;
	}
	@Override
	public GameElement simpleActivate() {
		return autoActivate();
	}
}
